import Vue from 'vue'
import Router from 'vue-router'
import Login from './views/login/login.vue'

Vue.use(Router)

export default new Router({
  linkExactActiveClass: '',
  routes: [
    {
      path: '/',
      redirect: {
        name: 'login'
      },
      component: Login
    },
    {
      path: '/login',
      name: 'login',
      meta: { keepAlive: true },
      component: Login
    },
    {
      path: '/register',
      name: 'register',
      meta: { keepAlive: false },
      component: () => import(/* webpackChunkName: "register" */ './views/register/register.vue')
    },
    {
      path: '/borrow',
      name: 'borrow',
      meta: { requireAuth: true, keepAlive: false },
      component: () => import(/* webpackChunkName: "borrow" */ './views/borrow/borrow.vue'),
      children: [
        {
          path: 'attestation',
          name: 'attestation',
          meta: { requireAuth: true, keepAlive: false },
          component: () => import(/* webpackChunkName: "attestation" */ './views/borrow/children/attestation.vue')
        },
        {
          path: 'identity',
          name: 'identity',
          meta: { requireAuth: true, keepAlive: false },
          component: () => import(/* webpackChunkName: "identity" */ './views/borrow/children/identity.vue')
        },
        {
          path: 'contacts',
          name: 'contacts',
          meta: { requireAuth: true, keepAlive: false },
          component: () => import(/* webpackChunkName: "contacts" */ './views/borrow/children/contacts.vue')
        },
        {
          path: 'card',
          name: 'card',
          meta: { requireAuth: true, keepAlive: false },
          component: () => import(/* webpackChunkName: "contacts" */ './views/borrow/children/card.vue')
        },
        {
          path: 'attestationNow',
          name: 'attestationNow',
          meta: { requireAuth: true, keepAlive: false },
          component: () => import(/* webpackChunkName: "attestation" */ './views/borrow/children/attestationNow.vue')
        }
      ]
    },
    {
      path: '/home',
      name: 'home',
      meta: { requireAuth: true, keepAlive: false },
      component: () => import(/* webpackChunkName: "home" */ './views/home/home.vue')
    },
    {
      path: '/me',
      name: 'me',
      meta: { requireAuth: true, keepAlive: false },
      component: () => import(/* webpackChunkName: "me" */ './views/me/me.vue'),
      children: [
        {
          path: 'record',
          name: 'record',
          meta: { requireAuth: true, keepAlive: false },
          component: () => import(/* webpackChunkName: "record" */ './views/me/children/record.vue')
        },
        {
          path: 'modification',
          name: 'modification',
          meta: { requireAuth: true, keepAlive: false },
          component: () => import(/* webpackChunkName: "modification" */ './views/me/children/modification.vue')
        },
        {
          path: 'about',
          name: 'about',
          meta: { requireAuth: true, keepAlive: true },
          component: () => import(/* webpackChunkName: "about" */ './views/me/children/about.vue')
        },
        {
          path: 'usinghelp',
          name: 'usinghelp',
          meta: { requireAuth: true, keepAlive: true },
          component: () => import(/* webpackChunkName: "usinghelp" */ './views/me/children/usinghelp.vue')
        }
      ]
    },
    {
      path: '/article/:id',
      name: 'article',
      meta: { requireAuth: true, keepAlive: false },
      component: () => import(/* webpackChunkName: "article" */ './views/article/article.vue')
    },
    {
      path: '/forgetPassWord',
      name: 'forgetPassWord',
      meta: { keepAlive: true },
      component: () => import(/* webpackChunkName: "article" */ './views/forget/forget.vue')
    }
  ]
})
